function validateUpload(extensions) {
	filepath = document.getElementById('add_local_file').mediafile.value;
	ext = filepath.substr(filepath.lastIndexOf('.') + 1).toLowerCase();
	valid = false;
	if (ext && extensions.match(ext)) {
		valid = true;
	} else {
		alert('You must upload a file with a valid extension.\nThe following extensions are valid:\n' + extensions);
		valid = false;
	}
	
	return valid;
	
}

function validateRemote(extensions) {
	filepath = document.getElementById('add_remote_file').url.value;
	ext = filepath.substr(filepath.lastIndexOf('.') + 1).toLowerCase();
	valid = false;
	if (ext && extensions.match(ext)) {
		valid = true;
	} else {
		alert('You must specify a file with a valid extension.\nThe following extensions are valid:\n' + extensions);
		valid = false;
	}
	
	return valid;
}

function validateIncoming(extensions) {
	filevalue = document.getElementById('add_incoming_file').incoming_file.value;
	ext = filevalue.substr(filevalue.lastIndexOf('.') + 1).toLowerCase();
	valid = false;
	if (ext && extensions.match(ext)) {
		valid = true;
	} else {
		alert('You must specify a file with a valid extension.\nThe following extensions are valid:\n' + extensions);
		valid = false;
	}
	
	return valid;
}